This IPython notebook was developed to allow simple and fast visualization of abundance and opacity data for planet and brown dwarf atmospheres. Using widgets, you can choose a pressure, temperature, metallicity, and molecule list, and then create plots of the mixing ratios and opacities.
To run, click inside the next cell and press Shift-Enter. Using the widgets, choose your pressure (bar), temperature (K), metallicity [M/H], and molecules you're interested in.
In [1]:
from IPython.html.widgets import interact, interactive, fixed, HTMLWidget
from IPython.display import display
import numpy as np
import matplotlib.pyplot as plt
import helperFunctions as hf
from IPython.display import Latex
%matplotlib inline
text1 = HTMLWidget(value='</br> <b>Choose the pressure, temperature, and metallicity</b> </br></br>')
opac=interactive(hf.getPT, log_pressure_layer=(-6,3,0.1), temp_layer=(75,4000,5))
mols=interactive(hf.getMoleculeList)
text2 = HTMLWidget(value='</br> <b>Click these check boxes to choose molecules<b> </br></br>')
met=interactive(hf.getMetallicity, metallicity=('0.0','0.3', '0.5', '0.7', '1.0', '1.5', '1.7'))
ch4=mols.children[0]; h2o=mols.children[1]; nh3=mols.children[2]; co=mols.children[3]; co2=mols.children[4]; feh=mols.children[5]; h2s=mols.children[6]; ph3=mols.children[7]; tio=mols.children[8]; vo=mols.children[9];
ch4.description = u'CH\u2084'; h2o.description = u'H\u2082O'; nh3.description = u'NH\u2083'; co.description = u'CO'; co2.description = u'CO\u2082'; feh.description = u'FeH'; h2s.description = u'H\u2082S'; ph3.description = u'PH\u2083'; tio.description = u'TiO';vo.description = u'VO';
display(text1); display(opac); display(met); display(text2); display(mols)
Make the abundance and opacity plots with the next two cells by clicking inside each cell and pressing Shift-Enter. (The opacity plot downloads data and may take up to a minute to load). Add any other normal matplotlib commands to the cell to change plot properties. Uncomment the savefig call to save the plot to disk. You can change the parameters above and rerun the cells below to update the figures.
In [2]:
fig1 = hf.makeAbundsPlot(opac.kwargs, opac.result, mols.result, met.result)
#plt.savefig('abunds_testplot.pdf')
In [4]:
fig2 = hf.makeOpacityPlot(opac.kwargs, opac.result, mols.result, met.result)
#plt.savefig('opacs_testplot.pdf')
Support for calculation of opacities and chemical equilibrium tables has been provided by NASA’s Astrophysics Theory and Planetary Atmospheres programs, Mark Marley, PI.
The opacity database is compiled from a variety of sources, combining lab-based data and numerical modeling. See Freedman et al. 2008 and Freedman et al. 2014 for details.
The abundances of molecular, atomic, and ionic species are calculated using the thermochemical equilibrium models of Fegley & Lodders (1994, 1996); Lodders (1999); Lodders & Fegley (2002); Lodders (2002, 2003); Lodders & Fegley (2006). We adopt solar composition elemental abundances from Lodders 2003). These models assume "rainout" chemistry, in which clouds form in layers, removing material from the atmosphere (see Lodders & Fegley (2006) Section 1.4 for an overview).
If you find this tool helpful for a project, please include the following acknowledgement in the resulting publication.
"This research has benefited from the Opacity Wizard tool developed by Caroline Morley."
And you should buy Caroline a beer at the next conference you attend.
If you have any questions or suggestions, please email Caroline Morley at cmorley@ucolick.org